package pattern3;

/**
 * p44
 * 装饰模式
 *
 * @author wdl
 */
public class DecorativePattern {
    public static void main(String[] args) {
        Person person = new Person("小菜");
        System.out.println("第一种装饰：");

        Sneaker sneaker = new Sneaker();
        BigTrouser bigTrouser = new BigTrouser();
        TShirt tShirt = new TShirt();

        sneaker.decorate(person);
        bigTrouser.decorate(sneaker);
        tShirt.decorate(bigTrouser);

        tShirt.show();

        System.out.println("\n第二种装饰：");
        Suit suit=new Suit();
        Tie tie=new Tie();
        LeatherShoes leatherShoes=new LeatherShoes();

        suit.decorate(person);
        tie.decorate(suit);
        leatherShoes.decorate(tie);

        leatherShoes.show();

    }
}
